package com.utils;


import com.environment.Percept;
import com.environment.Tile;
import com.knowledge.facts.Fact;
import java.util.Comparator;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author keithballantyne
 */
public class WeightedDistance implements Comparator<Fact>{

    private Tile locus;
    
    public WeightedDistance(Tile locus) {
        this.locus = locus;
    }
    
    @Override
    public int compare(Fact t1, Fact t2) {
//        int weight1 = Percept.getInstance().getIlk(t1.getLocation()).ordinal()+1;
//        int weight2 = Percept.getInstance().getIlk(t2.getLocation()).ordinal()+1;
                
        return Percept.getInstance().getDistance2(t1.getLocation(), locus) - Percept.getInstance().getDistance2(t2.getLocation(), locus);
    }

}
